package com.zzc.keleoj.judge.codesandbox;

import com.zzc.keleoj.judge.strategy.DefaultJudgeStrategy;
import com.zzc.keleoj.judge.strategy.JavaJudgeStrategy;
import com.zzc.keleoj.judge.strategy.JudgeContext;
import com.zzc.keleoj.judge.strategy.JudgeStrategy;
import com.zzc.keleoj.model.dto.questionSubmit.JudgeInfo;

public class judgeManager {
    public static JudgeInfo doJudge(JudgeContext judgeContext) {
        String code = judgeContext.getQuestionSubmit().getCode();
        JudgeStrategy judgeStrategy = new DefaultJudgeStrategy();
        if("java".equals(judgeContext.getQuestionSubmit().getLanguage())) {
            judgeStrategy = new JavaJudgeStrategy();
        }
        return judgeStrategy.doJudge(judgeContext);
    }
}
